<template>
  <div class="box">{{ 1 + 1 }} : {{ a }}</div>
  <Row>
    <Button type="default" @click="add">操作</Button>
    <Input-number :max="10" :min="0" v-model="model"></Input-number>
    <Button type="default" v-my="obj">测试</Button>
  </Row>
</template>
<script>
export default {
  data() {
    return {
      a: 1,
      b: 2,
      model: '1.00',
      obj: {
        a: 1,
        b: 2
      },
      list: [
        {
          url: ''
        }
      ]
    }
  },
  directives: {
    my: {
      mounted(el, attrs, vnode) {
        console.log(el, attrs, vnode)
        el.addEventListener('click', () => {
          console.log(`helloworld999`)
        })
      }
    }
  },
  methods: {
    add() {
      console.log(`helloworld`)
      this.a++
    }
  },
  mounted() {
    const url = this.list?.[0].url ?? 'https://dummyimage.com/200x200'
    console.log(url)
  }
}
</script>

<style lang="scss" scoped>
.box {
  width: 100px;
  height: 100px;
  border: 1px solid #000;
}
</style>
